const express = require('express');
const router = express.Router();

// 获取热门话题数据
router.post('/hotTopicData', (req, res) => {
  try {
    const data = [{
      id: 1,
      title: '你在说些啥',
      text: '你在说些啥呢？说些啥呢？',
      num: '138篇内容',
      img: '/static/images/home/grid-icon/16.png',
    }, {
      id: 2,
      title: '你在说些啥',
      text: '你在说些啥呢？说些啥呢？',
      num: '138篇内容',
      img: '/static/images/home/grid-icon/17.png',
    }, {
      id: 3,
      title: '你在说些啥',
      text: '你在说些啥呢？说些啥呢？',
      num: '138篇内容',
      img: '/static/images/home/grid-icon/18.png',
    }, {
      id: 4,
      title: '你在说些啥',
      text: '你在说些啥呢？说些啥呢？',
      num: '138篇内容',
      img: '/static/images/home/grid-icon/19.png',
    }, {
      id: 5,
      title: '你在说些啥',
      text: '你在说些啥呢？说些啥呢？',
      num: '138篇内容',
      img: '/static/images/home/grid-icon/20.png',
    }, {
      id: 6,
      title: '你在说些啥',
      text: '你在说些啥呢？说些啥呢？',
      num: '138篇内容',
      img: '/static/images/home/grid-icon/21.png',
    }, {
      id: 7,
      title: '你在说些啥',
      text: '你在说些啥呢？说些啥呢？',
      num: '138篇内容',
      img: '/static/images/home/grid-icon/22.png',
    }, {
      id: 8,
      title: '你在说些啥',
      text: '你在说些啥呢？说些啥呢？',
      num: '138篇内容',
      img: '/static/images/home/grid-icon/23.png',
    }, {
      id: 9,
      title: '你在说些啥',
      text: '你在说些啥呢？说些啥呢？',
      num: '138篇内容',
      img: '/static/images/home/grid-icon/24.png',
    }];
    
    res.json({
      code: 200,
      message: 'success',
      data: data
    });
  } catch (error) {
    res.status(500).json({
      code: 500,
      message: '服务器错误',
      data: null
    });
  }
});

// 获取推荐滚动数据
router.post('/recommendScrollData', (req, res) => {
  try {
    const data = [{
      id: 1,
      name: '仔仔',
      follow: false,
      avatar: '/static/images/avatar/1.jpg',
    }, {
      id: 2,
      name: '仔仔',
      follow: false,
      avatar: '/static/images/avatar/2.jpg',
    }, {
      id: 3,
      name: '仔仔',
      follow: true,
      avatar: '/static/images/avatar/3.jpg',
    }, {
      id: 4,
      name: '仔仔',
      follow: false,
      avatar: '/static/images/avatar/4.jpg',
    }, {
      id: 5,
      name: '仔仔',
      follow: true,
      avatar: '/static/images/avatar/5.jpg',
    }, {
      id: 6,
      name: '仔仔',
      follow: false,
      avatar: '/static/images/avatar/6.jpg',
    }, {
      id: 7,
      name: '仔仔',
      follow: false,
      avatar: '/static/images/avatar/7.jpg',
    }, {
      id: 8,
      name: '仔仔',
      follow: false,
      avatar: '/static/images/avatar/8.jpg',
    }];
    
    res.json({
      code: 200,
      message: 'success',
      data: data
    });
  } catch (error) {
    res.status(500).json({
      code: 500,
      message: '服务器错误',
      data: null
    });
  }
});

// 获取话题网格数据
router.post('/topicGridData', (req, res) => {
  try {
    const data = [{
      id: 1,
      title: '数码',
      img: '/static/images/home/goods/1.png'
    }, {
      id: 2,
      title: '穿搭',
      img: '/static/images/home/goods/2.png'
    }, {
      id: 3,
      title: '美妆',
      img: '/static/images/home/goods/3.png'
    }, {
      id: 4,
      title: '文玩',
      img: '/static/images/home/goods/4.png'
    }, {
      id: 5,
      title: '远动',
      img: '/static/images/home/goods/5.png'
    }, {
      id: 6,
      title: '数码',
      img: '/static/images/home/goods/6.png'
    }, {
      id: 7,
      title: '穿搭',
      img: '/static/images/home/goods/7.png'
    }, {
      id: 8,
      title: '美妆',
      img: '/static/images/home/goods/8.png'
    }];
    
    res.json({
      code: 200,
      message: 'success',
      data: data
    });
  } catch (error) {
    res.status(500).json({
      code: 500,
      message: '服务器错误',
      data: null
    });
  }
});

// 获取话题卡片数据
router.post('/topicCardData', (req, res) => {
  try {
    const data = [{
      id: 1,
      type: '数码',
      type_text: '游戏玩家的法宝是什么',
      bg_img: '/static/images/home/goods/1.png',
      list: [{
        id: 1,
        img: '/static/images/home/goods/2.png',
        title: '游戏玩家的至宝',
        text: '110篇内容'
      }, {
        id: 2,
        img: '/static/images/home/goods/3.png',
        title: '游戏玩家的至宝',
        text: '110篇内容'
      }, {
        id: 3,
        img: '/static/images/home/goods/4.png',
        title: '游戏玩家的至宝',
        text: '110篇内容'
      }, {
        id: 4,
        img: '/static/images/home/goods/5.png',
        title: '游戏玩家的至宝',
        text: '110篇内容'
      }, {
        id: 5,
        img: '/static/images/home/goods/6.png',
        title: '游戏玩家的至宝',
        text: '110篇内容'
      }]
    }, {
      id: 2,
      type: '测试',
      type_text: '测试玩家的法宝是什么',
      bg_img: '/static/images/home/goods/7.png',
      list: [{
        id: 1,
        img: '/static/images/home/goods/8.png',
        title: '游戏玩家的至宝',
        text: '110篇内容'
      }, {
        id: 2,
        img: '/static/images/home/goods/9.png',
        title: '游戏玩家的至宝',
        text: '110篇内容'
      }, {
        id: 3,
        img: '/static/images/home/goods/10.png',
        title: '游戏玩家的至宝',
        text: '110篇内容'
      }, {
        id: 4,
        img: '/static/images/home/goods/11.png',
        title: '游戏玩家的至宝',
        text: '110篇内容'
      }, {
        id: 5,
        img: '/static/images/home/goods/12.png',
        title: '游戏玩家的至宝',
        text: '110篇内容'
      }]
    }, {
      id: 3,
      type: '数码',
      type_text: '游戏玩家的法宝是什么',
      bg_img: '/static/images/home/goods/13.png',
      list: [{
        id: 1,
        img: '/static/images/home/goods/14.png',
        title: '游戏玩家的至宝',
        text: '110篇内容'
      }, {
        id: 2,
        img: '/static/images/home/goods/15.png',
        title: '游戏玩家的至宝',
        text: '110篇内容'
      }, {
        id: 3,
        img: '/static/images/home/goods/16.png',
        title: '游戏玩家的至宝',
        text: '110篇内容'
      }, {
        id: 4,
        img: '/static/images/home/goods/17.png',
        title: '游戏玩家的至宝',
        text: '110篇内容'
      }, {
        id: 5,
        img: '/static/images/home/goods/18.png',
        title: '游戏玩家的至宝',
        text: '110篇内容'
      }]
    }, {
      id: 4,
      type: '数码',
      type_text: '游戏玩家的法宝是什么',
      bg_img: '/static/images/home/goods/19.png',
      list: [{
        id: 1,
        img: '/static/images/home/goods/20.png',
        title: '游戏玩家的至宝',
        text: '110篇内容'
      }, {
        id: 2,
        img: '/static/images/home/goods/1.png',
        title: '游戏玩家的至宝',
        text: '110篇内容'
      }, {
        id: 3,
        img: '/static/images/home/goods/2.png',
        title: '游戏玩家的至宝',
        text: '110篇内容'
      }, {
        id: 4,
        img: '/static/images/home/goods/3.png',
        title: '游戏玩家的至宝',
        text: '110篇内容'
      }, {
        id: 5,
        img: '/static/images/home/goods/4.png',
        title: '游戏玩家的至宝',
        text: '110篇内容'
      }]
    }];
    
    res.json({
      code: 200,
      message: 'success',
      data: data
    });
  } catch (error) {
    res.status(500).json({
      code: 500,
      message: '服务器错误',
      data: null
    });
  }
});

module.exports = router;